<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
</head>
<body>
<h1>首页</h1>
<h3 id="head"></h3>
</body>
</html>

<script>
<!--    获取地址栏路径参数-->
    function getUrlParam(name) {
        const r = window.location.search;
        const param = new URLSearchParams(r);
        return param.get(name);
    }

    window.onload = function () {
        const username = getUrlParam("username");
        console.log(username);
        document.getElementById("head").innerHTML = "欢迎您：" + username;
    }
</script>